package com.djl.mymall.mbg.controller;




import com.alibaba.fastjson.JSON;
import com.djl.mymall.common.CommonPage;
import com.djl.mymall.common.CommonResult;
import com.djl.mymall.mbg.entity.Brand;
import com.djl.mymall.mbg.service.IBrandService;
import com.djl.mymall.mbg.service.impl.BrandServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;


/**
 * <p>
 * 品牌表 前端控制器
 * </p>
 *
 * @author djl
 * @since 2022-01-06
 */
@Api(tags = "PmsBrandController", description = "商品品牌管理")
@Controller
@RequestMapping("/brand")
@Slf4j
public class BrandController {
        @Autowired
        private IBrandService brandService;


        @PreAuthorize("hasAuthority('pms:brand:read')")
        @ApiOperation(value = "获取所有品牌列表")
        @ResponseBody
        @GetMapping("allList")
        public CommonResult<List<Brand>> getAllBrandList(){
                CommonResult commonResult=CommonResult.success(brandService.listAllBrand());
                System.out.println("hello");
            return commonResult;


        }



}
